#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;

int method()
{
	string s;
	getline(cin, s);
	istringstream sin(s);
	long sum = 0, a = 0, cnt = 0;

	while (sin >> a) {
		sum += a;
		cnt++;
	}

	cout << sum * ((1 << (cnt - 1))) << endl;

	return 0;
}

int sub_sum(vector<int> &num, int i, vector<int> &sub, long &sum)
{
	if (i == num.size()) {
		cout << "{ ";
		for (auto v : sub) {
			sum += v;
			cout << v << ' ';
		}
		cout << "}\n";
		return 0;
	}

	sub.push_back(num[i]);
	sub_sum(num, i + 1, sub, sum);
	sub.pop_back();
	sub_sum(num, i + 1, sub, sum);
	return 0;
}

int method2()
{
	string s;
	getline(cin, s);
	istringstream sin(s);
	long sum = 0, a = 0, cnt = 0;
	vector<int> num;
	while (sin >> a) {
		num.push_back(a);
		cnt++;
	}
	vector<int> sub;
	sub_sum(num, 0, sub, sum);
	cout << sum << endl;
	return 0;
}

int main()
{
	string s;
	getline(cin, s);
	istringstream sin(s);
	long sum = 0, a = 0, cnt = 0;
	vector<int> num;
	while (sin >> a) {
		num.push_back(a);
		cnt++;
	}

        for(int i = 1, j, bin; i < (1 << cnt); i++){
                bin = i;
                j = 0;
                while(bin){
                        if(bin & 1){
                                sum += num[j];
                        }
                        bin >>= 1;
                        j++;
                }
        }
        cout << sum << endl;
        return 0;
}